package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.FsdOrderMapper;
import com.ruoyi.system.domain.FsdOrder;
import com.ruoyi.system.service.IFsdOrderService;

/**
 * 订单Service业务层处理
 * 
 * @author ltl
 * @date 2025-07-16
 */
@Service
public class FsdOrderServiceImpl implements IFsdOrderService 
{
    @Autowired
    private FsdOrderMapper fsdOrderMapper;

    /**
     * 查询订单
     * 
     * @param orderId 订单主键
     * @return 订单
     */
    @Override
    public FsdOrder selectFsdOrderByOrderId(Long orderId)
    {
        return fsdOrderMapper.selectFsdOrderByOrderId(orderId);
    }

    /**
     * 查询订单列表
     * 
     * @param fsdOrder 订单
     * @return 订单
     */
    @Override
    public List<FsdOrder> selectFsdOrderList(FsdOrder fsdOrder)
    {
        return fsdOrderMapper.selectFsdOrderList(fsdOrder);
    }

    /**
     * 新增订单
     * 
     * @param fsdOrder 订单
     * @return 结果
     */
    @Override
    public int insertFsdOrder(FsdOrder fsdOrder)
    {
        fsdOrder.setCreateTime(DateUtils.getNowDate());
        return fsdOrderMapper.insertFsdOrder(fsdOrder);
    }

    /**
     * 修改订单
     * 
     * @param fsdOrder 订单
     * @return 结果
     */
    @Override
    public int updateFsdOrder(FsdOrder fsdOrder)
    {
        fsdOrder.setUpdateTime(DateUtils.getNowDate());
        return fsdOrderMapper.updateFsdOrder(fsdOrder);
    }

    /**
     * 批量删除订单
     * 
     * @param orderIds 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteFsdOrderByOrderIds(Long[] orderIds)
    {
        return fsdOrderMapper.deleteFsdOrderByOrderIds(orderIds);
    }

    /**
     * 删除订单信息
     * 
     * @param orderId 订单主键
     * @return 结果
     */
    @Override
    public int deleteFsdOrderByOrderId(Long orderId)
    {
        return fsdOrderMapper.deleteFsdOrderByOrderId(orderId);
    }
}
